<!--上传文件-->
<link rel="stylesheet" href="__STATIC__/admin/css/edit_common.css">

<link rel="stylesheet"type="text/css"href="__STATIC__/admin/uploadify/uploadify.css" />

<link rel="stylesheet" type="text/css" href="__CSS__/style.css"/>
<link rel="stylesheet" type="text/css" href="__CSS__/alliance.css"/>
<style>
    #commodity_main input[type=text]{width: 98%;}
    #commodity_main input[type=file]{margin-bottom: 10px;}
    #commodity_main img{width: 120px;height: 120px;border-radius: 50%;background-color: #FFFFFF;border-color:#FFFFFF;}
</style>

<div id="commodity_details">
    <h1 style="margin-top: 0px!important;">
        <img src="__STATIC__/admin/img/ico.png">
        图片编辑
    </h1>
    </h1>
</div>

<div class="page-content">
    <div class="row">
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            <form class="form-horizontal" role="form" method="post" url="{:url()}" id="edit_form">
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 图片 </label>
                    <div class="col-sm-9">
                        <select name="id">
                            {foreach name="list" item="ls"}
                            <option value="{$ls['id']}">{$ls['note']}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right"> 图片 </label>
                    <div class="col-sm-9">
                        <input id="file_upload"  type="file" multiple="true" >
                        <img style="display: none" id="upload_org_code_img" src="{$config['config_image']}" width="150" height="150">
                        <input id="file_upload_image" name="config_value" type="hidden" multiple="true" value="{$config['config_image']}">
                    </div>
                </div>

                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        <button class="btn btn-info" type="button" id="li1_btn">
                            <i class="icon-ok bigger-110"></i>
                            保存
                        </button>
                    </div>
                </div>
            </form>
        </div><!-- /.col -->

        <div class="section " style="text-align: center;" >
            <div class="shop">
                <div class="shop-img2">
                    <img src="{$list[0]['config_value']}" alt="" style="width: 100%;">
                </div>
            </div>
        </div>

        <div class="section" style="text-align: center;" id="pic_body">
            <div style="padding-right: 5px;">
                <span id="tip1">
                    <span>
                        <img src="{$list[1]['config_value']}" alt="" />
                        <img src="__IMG__/alliance/jmys.png" alt="" class="tip"/>
                    </span>
                </span>
                <span id="tip2">
                    <span>
        					<img src="{$list[2]['config_value']}" alt="" />
	        				<img src="__IMG__/alliance/jmtj.png" alt="" class="tip"/>
        				</span>
        			</span>
            </div>
            <div style="padding-left: 5px;">
        			<span id="tip3">
        				<span>
        					<img src="{$list[3]['config_value']}" alt="" />
	        				<img src="__IMG__/alliance/jmzc.png" alt="" class="tip2"/>
        				</span>
        			</span>
                <span id="tip4">
        				<span>
        					<img src="{$list[4]['config_value']}" alt="" />
	        				<img src="__IMG__/alliance/lxfs.png" alt="" class="tip2"/>
        				</span>
        			</span>
            </div>
        </div>
    </div><!-- /.row -->


</div><!-- /.page-content -->

{load href="__STATIC__/admin/js/image.js" /}
<script>
    $(".lm").addClass("active open");
    $(".lm .tpbj").addClass("active");

    $('#li1_btn').click(function(){
        $.ajax({
            type: 'POST',
            url: "{:url('index/saveConfig')}",
            data: $('#edit_form').serialize(),
            dataType: "json",
            beforeSend: function() {
                $('#li1_btn').attr('disabled','true');
                $('#li1_btn').attr('value','上传中...');
            },
            success: function(data) {
                alert(data.message);
                if(0==data.status){
                    window.location.reload()
                }else{
                    $('#li1_btn').removeAttr('disabled');
                    $('#li1_btn').attr('value','保存');
                }
            }
        });
    });
</script>
